home *** CD-ROM | disk | FTP | other *** search
- /*______________________________________________________________________________
-
- TAdev.h
-
- Include file for ADEV Calls for the Apple Internet Router.
-
- ••• Note •••
- You must get an itemRef assigned to you by MacDTS and replace the kXTIShellRef
- with the value assigned.
-
- Copyright Apple Computer, Inc. 1990-1993.
- All rights reserved.
- ______________________________________________________________________________*/
-
- #ifndef __TADEV__
- #define __TADEV__
-
- #include <Types.h>
- #include <QuickDraw.h>
-
- /*_________________________ Method-Based Interface _________________ */
-
- /* ___ Ref codes for itemRef field of adevItem record ___ */
-
- /* ___ DEVICES: hi word = hardware, lo word = id/slot ___ */
- #define kBuiltInRef 0x00010000 /* add built-in id to base num */
- #define kModemPort 1 /* modem port id */
- #define kPrinterPort 2 /* printer port id */
-
- #define kNuBusRef 0x00020000 /* if slots, add slot # to base num */
- #define kSCSIRef 0x00030000 /* add scsi id to base num */
-
- /* ___ PORTS: particular to each device ___ */
- #define kSerialNBPortBase 1 /* Serial NB ports 1...4 */
-
- /* ___ METHODS (use adev res id, or existing ref) ___ */
- #define kXTIShellRef 999 /* This is an invalid ref, change it to */
- /* assigned itemRef */
-
- /* ___ Device itemFlags masks ___ */
- #define kInfoFlagMask 0x80000000 /* Contains active information */
- #define kDefFlagMask 0x00000002 /* Use icon and string as default */
- #define kExclusFlagMask 0x00000001 /* Needs exclusive use of device/port */
-
- typedef struct TAdevIDRec {
- short aidSize;
- long aidData[8];
- } TAdevIDRec, *TAdevIDRecPtr, **TAdevIDRecHdl;
-
- typedef struct TAdevItem {
- long itemFlags;
- long itemRef;
- Handle itemIcon;
- StringHandle itemStr;
- } TAdevItem, *TAdevItemPtr, **TAdevItemHdl;
-
- typedef struct TAdevRec {
- short adevRecVers; /* version number of this structure, 0 for now */
- TAdevIDRec adevID; /* info about a particular port */
- long adevLocals[2]; /* internal ADEV field */
- TAdevItem adevDevice; /* attributes of device */
- TAdevItem adevPort; /* attributes of port */
- TAdevItem adevMethod; /* attributes of method */
- } TAdevRec, *TAdevRecPtr, **TAdevRecHdl;
-
-
- /*_________________________ Configuration User Interface Calls _________________ */
-
- /* ___ Modifier values (flags) ____ */
- #define kAttrDefButton 0x01 /* <-- MAGetAttr */
- #define kInitNeedsInit 0x01 /* --> MAInit */
- #define kKillCantFail 0x01 /* --> MAKill */
- #define kActivWind 0x01 /* --> MAActivate */
- #define kRouterActiv 0x02 /* --> MAInit */
- #define kShiftKey 0x01 /* --> MAClick, Key */
- #define kConfigChanged 0x01 /* <-- MAEdit, MAKey, Click */
- #define kMsgHasTEField 0x02 /* <-- Click, Key, GetConfig */
- #define kMsgHasTESelect 0x04 /* <-- Click, Key, Message */
-
- /* ____ Error Status Codes ___ */
-
- #define kMGetNoMore 1 /* MGetAdev */
- #define kMInsufDrawHt -1 /* GetAttrib */
- #define kMInitErr -1 /* Init */
- #define kMInitErrRep -2 /* Init error but adev reported it */
- #define kMCantClose -1 /* Kill */
- #define kMFatalErr -1 /* Activate, Click, Draw, Edit, Idle, Key, MGet */
- #define kMCantDeactTE -1 /* SelectTE */
- #define kMInvalConfig -1 /* Get Config -- don't close */
- #define kMDiscChanges -2 /* Get Config -- discard changes */
- #define kMPrintNoMore -1 /* Print -- no more to print after this one */
-
- /* ____ Message event codes ___ */
- #define kUndoEvt 0
- #define kCutEvt 1
- #define kCopyEvt 2
- #define kPasteEvt 3
- #define kClearEvt 4
- #define kRouterInact 5
- #define kRouterAct 6
- #define kAdjCursor 8
-
- /* ___ Print Message ___ */
- #define kPrintLine 'line'
-
- /* ___ Balloon Help constants ___ */
- #define kTipHOffset 10
- #define kTipVOffset 10
-
- #define kMaxSumStrLen 255
-
- typedef struct TAdevWind {
- WindowPtr awWiPtr; /* window where drawing occurs */
- Rect awRect; /* window rect where ADEV may draw into */
- long awMessage; /* event message (varies according to call) */
- short awModifiers; /* flags that affect awMessage */
- Handle awConfig; /* config data filled in by ADEV */
- Handle awVars; /* used by ADEV for temporary variables */
- Str255 awSumStr; /* summary string of current config data */
- Str255 awSum2Str; /* 2nd summary string used for printing config data */
- } TAdevWind, *TAdevWindPtr, **TAdevWindHdl;
-
-
- /* Glue for Icon routines. Eventually, these will be in a CInclude file */
- pascal OSErr NewIconSuite(Handle *theIconSuite) = {0x303C, 0x0207, 0xABC9};
- pascal OSErr AddIconToSuite(Handle theIconData,Handle theSuite,ResType theType)= {0x303C, 0x0608, 0xABC9};
- pascal OSErr GetIconFromSuite(Handle *theIconData,Handle theSuite,ResType theType)= {0x303C, 0x0609, 0xABC9};
- pascal OSErr GetIconSuite(Handle *theIconSuite,short theResID,long selector)= {0x303C, 0x0501, 0xABC9};
- pascal OSErr DisposeIconSuite(Handle theIconSuite,Boolean disposeData)= {0x303C, 0x0302, 0xABC9};
-
- #define svAllSmallData 0x0000ff00
-
- #endif